<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - 空白页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
<link rel="shortcut icon" href="favicon.ico">
    <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.css?v=4.4.0" rel="stylesheet">
     <link href="__STATIC__/layout/css/plugins/summernote/summernote.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/summernote/summernote-bs3.css" rel="stylesheet">
     <link rel="stylesheet" type="text/css" href="__STATIC__/layout/css/plugins/webuploader/webuploader.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/layout/css/demo/webuploader-demo.css">
    <!-- jqgrid-->
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <style>
       .radio-inline input[type=radio] {
            margin-top: 4px
        }
        .note-editable{height: 150px}
    </style>
</head>

<body style="color:#333;padding:3px;" class="x_sorll">
    <!-- 标题 -->
   <div class="page-heade">
      <h2 class="title_color text-center">核查任务通知书</h2>
    </div>
    <!-- 标题 -->
    <div class="row-margin-top">
    <form id="f1"  class="form-inline">
    <input type="hidden" value="{$hid}" name="hid" id="hid"/>
       <table class="table-bordered table t_table text-left">
           <tr>
            <td style="min-width: 160px;width: 160px"><label for="" >编号</label></td>
            <td>{$no}</td>
             <td style="min-width: 160px;width: 160px"><label for="" >填表人</label></td>
            <td>{$user.em_name}</td>
               <td style="min-width: 160px;width: 160px"><label for="" >填表人所在部门/职位</label></td>
            <td>{$user.de_name}/{$user.job_name}</td>
          </tr>
            <tr>
                <td style="min-width: 160px;width: 160px"><label for="" >检查人<span class="colorRed">*</span></label></td>
            <td>
                {$hename.em_name}
            </td>
              <td style="min-width: 160px;width: 160px"><label for="" >本通知书提交时间</label></td>
            <td>{$hechaday}</td>
            <td>状态</td><td>{$zhuangtai}</td>
            </tr>
          
        </table>
        <table class="table-bordered table-striped table text-center bud_hei">
        <thead>
            <tr class="info">
              <td>原申请文件编号</td>
              <td>明细编号</td>
              <td>区域</td>
              <td>省份</td>
              <td>城市</td>
              <td>类型</td>
              <td>责任人</td>
              <td>经销商名称</td>
              <td>网点名称</td>
              <td>网点详细地址</td>
              <td>费用科目</td>
              <td>费用额(元)</td>
              <td>原申请批复日期</td>
              <td>通知日期</td>
              <td>检核用时(天)</td>
              <td>检核结束日期</td>
              <td>检核状态</td>
              <td>检核结果</td>
            </tr>
          </thead>
          <tbody id="tb">
          {volist name="hechalist" id="vo"}
            <tr class='datas'><input class='apdids' type='hidden' name='apdid[]' value='{$vo.list_id}'/>
              {if $vo.type_id==2}
                <td><a onclick='xiangqing({$vo.apid})'>{$vo.apno}</a></td>
              {elseif $vo.type_id==0/}
                <td><a onclick='fxiangqing({$vo.apid})'>{$vo.apno}</a></td>
              {else/}
                <td><a onclick='jxiangqing({$vo.apid})'>{$vo.apno}</a></td>
              {/if}
              <td>{$vo.apno}_{$vo.apdno}</td>
              <td>{$vo.fenqu}</td><td>{$vo.sheng}</td><td>{$vo.shi}</td>
               {if $vo.type_id==2}
                <td>常规促销</td>
              {elseif $vo.type_id==0/}
                <td>非常规促销</td>
              {else/}
                <td>进场费用</td>
              {/if}
              <td>{$vo.zerenren}</td><td>{$vo.jxs}</td><td>{$vo.net}</td>
              <td>{$vo.dizhi}</td>
              <td>{$vo.pays}</td><td>{$vo.pizhunweishui}</td><td>{$vo.ptime}</td>
              <td>{$vo.tongzhi}</td><td></td> <td>{$vo.jieshu}</td><td>{if $vo.result}完成{else/}未完成{/if}</td>
              <td>{if $vo.result}{if $vo.result==1}通过{else/}未通过{/if}{else/} /{/if}</td>
            </tr>
          {/volist}
          </tbody>
          <tfoot>
            <tr class="info"><td colspan="18">操作说明<span class="colorRed">*</span></td></tr>
            <tr>
              <td colspan="18" class="text-left">
                  {$hechabeizhu}
              
              </td>
            </tr>
            </tfoot>
         </table>
         </div> 
       <div class="row sub_btn" style="width:100%;text-align:center;padding: 20px 0">
        
        <input type="button" class="btn btn-warning" value="返回" onclick="back()">
    </div>
</form>
    </div>
    <!-- 全局js -->
    <script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
    <script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
     <script src="__STATIC__/layout/js/plugins/summernote/summernote.min.js"></script>
    <script src="__STATIC__/layout/js/plugins/summernote/summernote-zh-CN.js"></script>
    <!--统计代码，可删除-->
    <script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
      <script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>
        <script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
    <script>

$("#sub").click(function(){
  var flag=0;
  $(".apdids").each(function(){
    flag++;
  })
  var msg="";
    if($("#he_em").val()==0){
        msg="核检人必须选择";
    }else if(flag==0){
      msg="至少下发一条明细";
    }else if($("#hecha").val()==""){
      msg="核查说明不能为空";
    }
    if(msg==""){

                $.ajax({
                        cache: true,
                        type: "POST",
                        url:"{:url('upadd')}",
                        data:$('#f1').serialize(),// 你的formid
                        async: false,
                        error: function(requests) {
                            alert("Connection error");
                        },
                        success:function(datas){
                          //alert(datas);
                          
                          var res1=JSON.parse(datas);
                          if(res1["state"]==1){
                            swal({
                              title: "完成",
                              text: "操作已成功",
                              type: "success"
                              },function(){
                               location.href='{:url("lists")}';
                              });
                                    }else{
                                      swal({
                              title: "错误",
                              text:  res1["msg"],
                              type: "warning"
                              });
                                    }
                                  }
                       })
    }else{
       swal({
                    title: "错误",
                    text:  msg,
                    type: "warning"
                    });
    }
                /**/
  
})
    //详情也
function xiangqing(aid){
     var index = layer.open({
                            type:2,
                            title:'常规促销申请',
                            area:['100%','100%'],
                            maxmin:true,
                            content:'{:url("Ti_apply/apply_de")}?aid='+aid
                        })
}
  //详情也
function fxiangqing(aid){
     var index = layer.open({
                            type:2,
                            title:'非常规促销申请',
                            area:['100%','100%'],
                            maxmin:true,
                            content:'{:url("Ti_apply2/view")}?id='+aid
                        })
}
 //详情也
function jxiangqing(aid){
     var index = layer.open({
                            type:2,
                            title:'进场费用申请',
                            area:['100%','100%'],
                            maxmin:true,
                            content:'{:url("Tijinchang/view")}?id='+aid
                        })
}
        $(document).ready(function () {

            $('.summernote').summernote({
                lang: 'zh-CN'
            });
        });
        /*添加核查明细*/
        $("#addExaDetail").click(function(){
          var index = layer.open({
                        type:2,
                        title:'核查活动明细',
                        shadeClose: true,
                        shade: false,
                        maxmin: true, //开启最大化最小化按钮
                        area: ['60%', '80%'],
                        content:'{:url("chazhao")}'
                    })
                    layer.full(index)
        })
       
        /*返回按钮*/
        function back(){
          history.go(-1);
        }
         $('body').on("click",".sc",function(){
            $(this).parent().parent().remove();
         })
    </script>


</body>

</html>
